/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelAyudantia.java
 *
 * Created on 14-nov-2011, 23:25:11
 */
package PanelesAlumno;


import FormulariosMensajes.FormularioAyudantias;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.Calendar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.table.DefaultTableModel;


/**
 *
 * @author VReyes
 */
public class PanelAyudantia extends javax.swing.JPanel {

    /** Creates new form PanelAyudantia */
    
    private CardLayout card;
    private ArrayList<FormularioAyudantias> ArrayDeInformacion;
    
    public PanelAyudantia() {
        initComponents();
        card = (CardLayout)this.jPanel3.getLayout();
        this.ArrayDeInformacion = new ArrayList<FormularioAyudantias>();
    }

     

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        BotonBorrar = new javax.swing.JButton();
        BotonNuevo = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jComboBoxEstado1 = new javax.swing.JComboBox();
        BotonEditar = new javax.swing.JButton();
        BotonVer = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel5 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jTextField11 = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jComboBox1 = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();
        jLabel17 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jEditorPane2 = new javax.swing.JEditorPane();

        setLayout(new java.awt.BorderLayout());

        jPanel3.setLayout(new java.awt.CardLayout());

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Solicitud de Ayudantías"));
        jPanel4.setPreferredSize(new java.awt.Dimension(622, 389));

        BotonBorrar.setText("Borrar");
        BotonBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonBorrarActionPerformed(evt);
            }
        });

        BotonNuevo.setText("Nuevo");
        BotonNuevo.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        BotonNuevo.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
        BotonNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonNuevoActionPerformed(evt);
            }
        });

        jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/16x16/1320861601_gnome-searchtool.png"))); // NOI18N
        jLabel12.setText("Filtrar por:");

        jLabel14.setText("Fecha:");

        jTextField7.setEditable(false);

        jLabel15.setText("Estado:");

        jComboBoxEstado1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Todos", "Borrador", "Enviado" }));

        BotonEditar.setText("Editar");

        BotonVer.setText("Ver");
        BotonVer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonVerActionPerformed(evt);
            }
        });

        jLabel16.setText("Frase o palabra:");

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Seleccion", "Estado", "Fecha", "Hora", "Módulo", "Profesor"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                true, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setDragEnabled(true);
        jScrollPane3.setViewportView(jTable1);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 676, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(BotonNuevo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BotonVer)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BotonEditar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BotonBorrar))
                    .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(45, 45, 45)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxEstado1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(43, 43, 43)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField8)
                    .addComponent(jLabel15)
                    .addComponent(jComboBoxEstado1)
                    .addComponent(jLabel16))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BotonNuevo)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(BotonBorrar)
                        .addComponent(BotonEditar)
                        .addComponent(BotonVer))))
        );

        jPanel3.add(jPanel4, "panelTabla");

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Solicitud de Ayudantías"));
        jPanel5.setPreferredSize(new java.awt.Dimension(622, 389));

        jLabel4.setText("Profesor a Cargo:");

        jLabel5.setText("Número de Horas:");

        jLabel6.setText("Módulo:");

        jLabel13.setText("Requisitos de Postulación:");

        jButton8.setText("Guardar en borrador");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jButton12.setText("Enviar");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jButton13.setText("Cancelar");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ecuaiones diferenciales\t", "Programacion\t", "Arquitectura de computadores\t", "Bases de datos" }));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jScrollPane1.setViewportView(jEditorPane1);

        jLabel17.setText("Observaciones:");

        jScrollPane2.setViewportView(jEditorPane2);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(48, 48, 48)))
                                .addGap(15, 15, 15)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(59, 59, 59)
                                        .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jTextField9, javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE))
                                .addGap(200, 200, 200))
                            .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
                        .addGap(200, 200, 200))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(596, Short.MAX_VALUE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
                        .addGap(200, 200, 200))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                        .addGap(111, 111, 111)
                        .addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
                        .addGap(200, 200, 200))))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jLabel4))
                    .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel6)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                    .addComponent(jButton8)
                    .addComponent(jButton12)
                    .addComponent(jButton13))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.add(jPanel5, "formulario");

        add(jPanel3, java.awt.BorderLayout.CENTER);

        getAccessibleContext().setAccessibleName("");
        getAccessibleContext().setAccessibleParent(this);
    }// </editor-fold>//GEN-END:initComponents
    
private void BotonBorrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonBorrarActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_BotonBorrarActionPerformed

public String agregarFecha()
{
    Calendar c= Calendar.getInstance();
   String s= Integer.toString(c.get(Calendar.DATE)) + "/" 
           + Integer.toString(c.get(Calendar.MONTH)) + "/"
           + Integer.toString(c.get(Calendar.YEAR));
   return s;
}

private void BotonNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonNuevoActionPerformed
// TODO add your handling code here:
       this.jTextField9.setEditable(true);
            this.jComboBox1.setEnabled(true);
            this.jTextField11.setEditable(true);
            this.jEditorPane1.setEditable(true); 
        this.jEditorPane2.setEditable(true);
    card.show(this.jPanel3,"formulario");
                
}//GEN-LAST:event_BotonNuevoActionPerformed

private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
// TODO add your handling code here:
    this.agregarMensaje("enviado");
    this.card.show(this.jPanel3,"panelTabla");
}//GEN-LAST:event_jButton12ActionPerformed

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// TODO add your handling code here:
    this.limpiarFormulario();
    this.card.show(this.jPanel3,"panelTabla");
    
}//GEN-LAST:event_jButton13ActionPerformed

private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
// TODO add your handling code here:
    this.agregarMensaje("borrador");
    this.card.show(this.jPanel3,"panelTabla");
}//GEN-LAST:event_jButton8ActionPerformed

private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jComboBox1ActionPerformed

    private void BotonVerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonVerActionPerformed
        // TODO add your handling code here:
        if(-1 != this.jTable1.getSelectedRow()) //Devuelve -1 si no esta seleccionada
        {
            int columnaFecha= 2;
            int columnaHora= 3;
            int fila = this.jTable1.getSelectedRow();
            String fecha=  String.valueOf(this.jTable1.getValueAt(fila,columnaFecha));
            String hora= String.valueOf(this.jTable1.getValueAt(fila,columnaHora));
                for(int i=0; i<= ArrayDeInformacion.size();i++)
                {
                    if(ArrayDeInformacion.get(i).getFecha().equals(fecha) && ArrayDeInformacion.get(i).getHora().equals(hora))
                    {
                        visualizarMensaje(ArrayDeInformacion.get(i));
                        break;
                    }
                }
        }
        
        else
        {
            JOptionPane.showMessageDialog(this,"Debe seleccionar una fila!","Advertencia", JOptionPane.WARNING_MESSAGE);
        }
    }//GEN-LAST:event_BotonVerActionPerformed
    
    
public FormularioAyudantias crearMensaje(){
    
    String profesor=this.jTextField9.getText();//tf9
    String modulo=(String)this.jComboBox1.getSelectedItem();//com1
    int numHoras=(this.jTextField11.getText().equals("")) ? 0:Integer.parseInt(this.jTextField11.getText());//tf11
    String requisitos=this.jEditorPane1.getText();//edit1    
    String observaciones=this.jEditorPane2.getText();
    limpiarFormulario();
    
    
    FormularioAyudantias mensaje= new FormularioAyudantias(profesor,modulo,numHoras,requisitos,observaciones);
    this.ArrayDeInformacion.add(mensaje);
    return mensaje;
  
        
    
}


public void limpiarFormulario(){
    this.jTextField9.setText("");
    this.jTextField11.setText("");
    this.jEditorPane1.setText("");
    this.jEditorPane2.setText("");
    this.jComboBox1.setSelectedItem(" ");
}




public void agregarMensaje(String estado){
    FormularioAyudantias msje=crearMensaje();
    msje.setFecha(agregarFecha());
    msje.setEstado(estado);
    int numRows = ArrayDeInformacion.size();
    Object fila[]= {msje.isEstaSeleccionado(),msje.getEstado(),msje.getFecha(),msje.getHora(),msje.getModulo(),msje.getProfesor()};

    DefaultTableModel modelo = (DefaultTableModel)this.jTable1.getModel();
    modelo.addRow(fila);


}
    
 
public void actualizarTabla(){
    int i=0;
    
    while(i<this.ArrayDeInformacion.size()) 
    {
        
        FormularioAyudantias msje=ArrayDeInformacion.get(i);
        Object fila[]= {msje.isEstaSeleccionado(),msje.getEstado(),msje.getFecha(),msje.getHora(),msje.getModulo(),msje.getProfesor()};
        DefaultTableModel modelo = (DefaultTableModel)this.jTable1.getModel();
        modelo.addRow(fila);
        i++;
    }    
 }

    
    public ArrayList<FormularioAyudantias> getArrayDeInformacion() {
        return ArrayDeInformacion;
    }

    public void setArrayDeInformacion(ArrayList<FormularioAyudantias> ArrayDeInformacion) {
        this.ArrayDeInformacion = ArrayDeInformacion;
        actualizarTabla();
    }


    public CardLayout getCard() {
        return card;
    }

    public void setCard(CardLayout card) {
        this.card = card;
    }

    public JPanel getjPanel3() {
        return jPanel3;
    }

    public void setjPanel3(JPanel jPanel3) {
        this.jPanel3 = jPanel3;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonBorrar;
    private javax.swing.JButton BotonEditar;
    private javax.swing.JButton BotonNuevo;
    private javax.swing.JButton BotonVer;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton8;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBoxEstado1;
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JEditorPane jEditorPane2;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    // End of variables declaration//GEN-END:variables
 private void visualizarMensaje(FormularioAyudantias mensaje) {
        this.jTextField9.setText(mensaje.getProfesor());
        this.jComboBox1.setSelectedItem(mensaje.getModulo()); 
        this.jTextField11.setText(Integer.toString(mensaje.getNumHoras()));
        this.jEditorPane1.setText(mensaje.getRequisitos()); 
        this.jEditorPane2.setText(mensaje.getObservaciones());
        
        if(mensaje.getEstado().equals("enviado"))
        {
            this.jButton12.setEnabled(false);
            this.jTextField9.setEditable(false);
            this.jComboBox1.setEnabled(false);
            this.jTextField11.setEditable(false);
            this.jEditorPane1.setEditable(false);
            this.jEditorPane2.setEditable(false);
        }
        else
        {
            this.jTextField9.setEditable(true);
            this.jComboBox1.setEnabled(true);
            this.jTextField11.setEditable(true);
            this.jEditorPane1.setEditable(true); 
        this.jEditorPane2.setEditable(true);
        }
        card.show(this.jPanel3, "formulario");
        
}
}
